<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改系统设置')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-set-edit" th:object="${sysSet}">
        <input name="id" th:field="*{id}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label">每天滑动次数：</label>
            <div class="col-sm-8">
                <input name="eachDayNum" th:field="*{eachDayNum}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">开通会员每天可滑动次数：</label>
            <div class="col-sm-8">
                <input name="vipDayNum" th:field="*{vipDayNum}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">注册赠送滑动次数：</label>
            <div class="col-sm-8">
                <input name="registerFreeNum" th:field="*{registerFreeNum}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">会员开通赠送滑动次数：</label>
            <div class="col-sm-8">
                <input name="vipFreeNum" th:field="*{vipFreeNum}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">邀请好友赠送滑动次数：</label>
            <div class="col-sm-8">
                <input name="inviteFreeNum" th:field="*{inviteFreeNum}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">绑定关系赠送滑动次数：</label>
            <div class="col-sm-8">
                <input name="bindingFreeNum" th:field="*{bindingFreeNum}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">提现最低限制：</label>
            <div class="col-sm-8">
                <input name="withdrawLowest" th:field="*{withdrawLowest}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">提现开始时间(号)：</label>
            <div class="col-sm-8">
                <input name="withdrawStar" th:field="*{withdrawStar}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">提现结束时间(号)：</label>
            <div class="col-sm-8">
                <input name="withdrawOver" th:field="*{withdrawOver}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">折现比例：</label>
            <div class="col-sm-8">
                <input name="discountRate" th:field="*{discountRate}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">消费一钻石对应多少财富值：</label>
            <div class="col-sm-8">
                <input name="treasure" th:field="*{treasure}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">分享赠送次数：</label>
            <div class="col-sm-8">
                <input name="treasure" th:field="*{shareNum}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">腾讯im的管理员名：</label>
            <div class="col-sm-8">
                <input name="timAdmin" th:field="*{timAdmin}" class="form-control" type="text">
            </div>
        </div>
        <!--<div class="form-group">
            <label class="col-sm-3 control-label">腾讯im的管理者秘钥：</label>
            <div class="col-sm-8">
                <input name="timSig" th:field="*{timSig}" class="form-control" type="text">
            </div>
        </div>-->
    </form>
    <button type="button" th:onclick="submitHandler()" style="float: left;margin-left: 85%;margin-top: 5%" class="btn btn-primary">保存</button>
</div>
<th:block th:include="include :: footer"/>
<script type="text/javascript">
    var prefix = ctx + "system/set";
    $("#form-set-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            var config = {
                url: prefix + "/edit",
                type: "post",
                dataType: "json",
                data: $('#form-set-edit').serialize(),
                beforeSend: function () {
                    $.modal.loading("正在处理中，请稍后...");
                },
                success: function (result) {
                    if (typeof callback == "function") {
                        callback(result);
                    }
                    if (result.code == web_status.SUCCESS) {
                        $.modal.alertSuccess(result.msg)
                    } else if (result.code == web_status.WARNING) {
                        $.modal.alertWarning(result.msg)
                    } else {
                        $.modal.alertError(result.msg);
                    }
                    $.modal.closeLoading();
                }
            };
            $.ajax(config)
        }
    }
</script>
</body>
</html>